# 导包
import requests
import config


# 创建接口类
class LoginAPI:
    # 初始化
    def __init__(self):
        self.url_login = config.BASE_URL + "/api/sys/login"

    # 登录
    def login(self, test_data):
        return requests.post(url=self.url_login, json=test_data)


if __name__ == '__main__':
    login_api = LoginAPI()
    response = login_api.login(config.LOGIN_DATA)
    print(response.status_code)
    print(response.json())
